<?php
	require_once('MysqlConnect.php');
	//检验
	
	$title=$_POST['title'];
	$author=$_POST['author'];
	$description=$_POST['description'];
	$content=$_POST['content'];
	$dateline=time();

	if(!$title) {echo "<script>alert('标题不能为空');window.location.href='Article_add_display.php'</script>"; exit();}
	if(!$author) {echo "<script>alert('作者不能为空');window.location.href='Article_add_display.php'</script>"; exit();}
	if(!$content) {echo "<script>alert('内容不能为空');window.location.href='Article_add_display.php'</script>"; exit();}

	//插入
	$ins="insert articlelist (title,author,description,content,dateline) values('$title','$author','$description','$content',$dateline)";
	if(mysql_query($ins)){
		echo "<script>alert('文章添加成功');window.location.href='Article_add_display.php'</script>";
	}
	else{
		echo mysql_errno();
		echo "<script>alert('文章添加失败');window.location.href='Article_add_display.php'</script>";
	}
?>